package com.lagou.rocket.rest;

import com.lagou.rocket.entity.Order;
import com.lagou.rocket.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yutao
 * @create 2020-10-13 23:22
 **/
@RestController
@RequestMapping("order")
public class OrderRest {

    @Autowired
    private OrderService orderService;


    @GetMapping("submitOrder")
    public String submitOrder(String goods, Integer num) {
        return orderService.submitOrder(goods,num);
    }

    @GetMapping("pay")
    public Boolean pay(String id) {
        return orderService.pay(id);
    }

    @GetMapping("get")
    public Order get(String id) {
        return orderService.get(id);
    }

    @GetMapping("listOrder")
    public List<Order> listOrder(){
        return orderService.listOrder();
    }

}
